package com.sise.stuteaintersys.config;

import org.springframework.boot.web.servlet.MultipartConfigFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import javax.servlet.MultipartConfigElement;

/**
 */

@Configuration
public class CommonConfig {

	/**
	 * 设置上传文件大小
	 * 
	 * @return
	 */
	@Bean
	public MultipartConfigElement multipartConfigElement() {
		MultipartConfigFactory factory = new MultipartConfigFactory();
		//设置最大50M
		factory.setMaxFileSize(50 * 1024L * 1024L);
		return factory.createMultipartConfig();
	}

}